/*
 *    Copyright (c) 2018-2025, cloud All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: cloud
 */

package com.fuyao.cloud.asset.borrow.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fuyao.cloud.asset.dto.borrow.BorrowCreateDTO;
import com.fuyao.cloud.asset.dto.borrow.BorrowEditDTO;
import com.fuyao.cloud.asset.dto.borrow.BorrowExcelDTO;
import com.fuyao.cloud.asset.dto.borrow.BorrowSearchDTO;
import com.fuyao.cloud.asset.entity.borrow.Borrow;
import com.fuyao.cloud.common.core.util.R;

import java.util.List;

/**
 * 借用&归还表
 *
 * @author ly
 * @date 2022-01-06 10:37:40
 */
public interface BorrowService extends IService<Borrow> {

	/**
	 * 借用创建对象
	 *
	 * @return 创建对象
	 */
	BorrowCreateDTO create();

	/**
	 * 借用编辑对象
	 *
	 * @param id 借用id
	 * @return 编辑对象
	 */
	BorrowEditDTO edit(Long id);

	/**
	 * 归还方法
	 *
	 * @param ids 借用ids
	 * @return 是否归还成功。
	 */
	boolean updateRemand(List<Long> ids);

	/**
	 * 重写导入方法
	 *
	 * @param query 查询构造器
	 * @return 导出集合
	 */
	List<BorrowExcelDTO> listBorrow(QueryWrapper<Borrow> query);

	/**
	 * 重写分页查询方法。
	 *
	 * @param page         分页对象
	 * @param queryWrapper 查询构造器
	 * @param borrow       查询对象
	 * @return 分页对象
	 */
	IPage<Borrow> page(Page page, QueryWrapper queryWrapper, BorrowSearchDTO borrow);

	/**
	 * 批量删除
	 * @param ids 业务ids集合
	 * @return R
	 */
    R batchDelete(List<Long> ids);

    boolean approval(Borrow borrow);
}
